package client;

import java.util.ArrayList;

import javax.swing.JFrame;
import javax.swing.JLabel;

import model.Sensor;
import model.SensorController;

import customLayouts.VerticalFlowLayout;

public class WarningWindow extends JFrame {

	private static final long serialVersionUID = 1L;

	public WarningWindow(){
		super("Warnings");
		setSize(400,400);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setLayout(new VerticalFlowLayout());
		
		JLabel title = new JLabel("Risky sensors:");
		add(title);
		
		ArrayList<Sensor> list = SensorController.getInstance().getRiskySensors();
		
		for(Sensor s : list){
			JLabel sens = new JLabel(s.getName());
			add(sens);
		}
		
		setVisible(true);
	}

}
